package com.bdqn.t330.ch05.service;

import com.bdqn.t330.ch05.dao.UserDao;
import com.bdqn.t330.ch05.dao.UserDaoImp;
import com.bdqn.t330.ch05.entity.User;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import javax.annotation.Resource;

public class UserServiceImp implements UserService {

    private Logger logger = Logger.getLogger(UserService.class);

    private UserDao userDao;
    private int money;

    public void setMoney(int money) {
        this.money = money;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public boolean save(User user) {
        //logger.info("添加用户：" + user.getUname());
        //logger.info("money：" + money);

        userDao.addDao(user);
        //System.out.println(1/0);
        return true;
    }
}
